package com.gxa.controller;

import com.gxa.pojo.MenuSet;
import com.gxa.utils.Constants;
import com.gxa.utils.ResponseData;
import io.swagger.annotations.*;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * Created with IntelliJ IDEA.
 * User: tx
 * Date: 2020/11/26 14:41
 * Description:
 * Version: V1.0
 */
@RestController
@Api(value = "菜单管理设置",tags = "菜单管理设置")
@RequestMapping(value = "options")
public class MenuMenController {

    @Autowired
    private ResponseData responseData;
    @Autowired(required = false)
    private Constants constants;

    @PostMapping("/addMenuMenOptions")
    @ApiOperation(value = "添加菜单管理信息",notes = "根据提交的信息添加菜单管理信息",httpMethod = "POST",response = ResponseData.class)
    @ApiResponses({
            @ApiResponse(code = 200, message = "添加成功"),
            @ApiResponse(code = 400, message = "找不到页面"),
            @ApiResponse(code = 500, message = "添加失败")
    })
    public ResponseData addMenuMenOptions(@RequestBody @ApiParam(name = "menuSet",value = "菜单管理信息",required = true) MenuSet menuSet){
        responseData.setCode(Constants.SUCCESS);
        responseData.setMsg("添加成功");
        responseData.setData(null);
        return responseData;
    }



    @GetMapping("/delMenuMenOptions")
    @ApiOperation(value = "是否启用菜单管理信息",notes = "根据提交的信息是否启用菜单管理信息",httpMethod = "GET",response = ResponseData.class)
    @ApiResponses({
            @ApiResponse(code = 200, message = "是否启用成功"),
            @ApiResponse(code = 400, message = "找不到页面"),
            @ApiResponse(code = 500, message = "是否启用失败")
    })
    public ResponseData delMenuMenOptions(@ApiParam(name = "menuEnalbStatu",value = "菜单管理状态",required = true) int menuEnalbStatu){
        responseData.setCode(Constants.SUCCESS);
        responseData.setMsg("menuEnalbStatu");
        responseData.setData(null);
        return responseData;
    }




    @GetMapping("/updateMenuMenOptions")
    @ApiOperation(value = "修改菜单管理信息",notes = "根据提交的信息修改菜单管理信息",httpMethod = "GET",response = ResponseData.class)
    @ApiResponses({
            @ApiResponse(code = 200, message = "修改成功"),
            @ApiResponse(code = 400, message = "找不到页面"),
            @ApiResponse(code = 500, message = "修改失败")
    })
    public ResponseData updateMenuMenOptions(@ApiParam(name = "menuId",value = "菜单管理id",required = true) int menuId){
        responseData.setCode(Constants.SUCCESS);
        responseData.setMsg("修改成功");
        responseData.setData(menuId);
        return responseData;
    }





    @PostMapping("/queryMenuMenOptions")
    @ApiOperation(value = "查询菜单管理信息",notes = "根据提交的信息查询菜单管理信息",httpMethod = "POST",response = ResponseData.class)
    @ApiResponses({
            @ApiResponse(code = 200, message = "查询成功"),
            @ApiResponse(code = 400, message = "找不到页面"),
            @ApiResponse(code = 500, message = "查询失败")
    })
    public ResponseData queryMenuMenOptions(@ApiParam(name = "menuSet",value = "菜单管理信息",required = true) MenuSet menuSet){
        menuSet.setMenuName("菜单1");
        menuSet.setMenuEnalbStatu(1);
        menuSet.setMenuLink("hfaiusgfuiqwhof/sadfguy8qegfuyqwegfuyg");
        responseData.setCode(Constants.SUCCESS);
        responseData.setMsg("查询成功");
        responseData.setData(menuSet);
        return responseData;
    }
}
